import Vue from "vue";
import VueRouter from "vue-router";

const Home = () => import(/* webpackChunkName:"home" */ "../views/Home.vue");

const User = () =>
  import(/* webpackChunkName:"user" */ "../views/User/User.vue");
const Shop = () =>
  import(/* webpackChunkName:"user" */ "../views/Shop/Shop.vue");
const Discount = () =>
  import(/* webpackChunkName:"user" */ "../views/Discount/Discount.vue");
const Order = () =>
  import(/* webpackChunkName:"user" */ "../views/Order/Order.vue");
const Send = () =>
  import(/* webpackChunkName:"user" */ "../views/Order/Sending_goods.vue");
const Chart = () =>
  import(/* webpackChunkName:"chart" */ "../views/Pages/Chart.vue");
const Poster = () =>
  import(/* webpackChunkName:"poster" */ "../views/Pages/Poster.vue");
const Audit = () =>
  import(/* webpackChunkName:"user" */ "../views/Audit/Audit.vue");
const Refund = () =>
  import(/* webpackChunkName:"user" */ "../views/Audit/Refunding_aduit.vue");

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: Home,
    redirect: "/chart",
    children: [
      { path: "/user", component: User },
      { path: "/shop", component: Shop },
      { path: "/discount", component: Discount },
      { path: "/order", component: Order },
      { path: "/sending_goods", component: Send },

      { path: "/chart", component: Chart },
      { path: "/poster", component: Poster },

      { path: "/audit", component: Audit },
      { path: "/refunding_audit", component: Refund },
    ],
  },
];



const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes,
});

export default router;
